import { Injectable } from '@angular/core';

import { MatDialog, MatDialogRef } from '@angular/material/dialog';

@Injectable()
export class MaterialDialogService {
    constructor(private dialog: MatDialog) { }

    openDialog(component: any, value: any, width?: string | null): MatDialogRef<any, any> {
        return this.dialog.open(component, {
            width: width,
            data: value,
            disableClose: true,
        });
    }
}